package com.atguigu.tingshu.search.api;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.search.service.LockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author:huzhongkui
 * Date: 2025-03-22 星期六 13:48:09
 * Description:
 */


@RestController
@RequestMapping("api/search/v1/test/lock")
public class TestLocalApiController {


    @Autowired
    private LockService lockSerivce;


    @GetMapping("/testLocalLock")
    public Result testLocalLock() {


        lockSerivce.testLocalLock();
        return Result.ok();

    }

    @GetMapping("/testDistroLock")
    public Result testDistroLock() {


        lockSerivce.testDistroLock();
        return Result.ok();

    }


    @GetMapping("/testDistroLock/redisson")
    public Result testDistroLockByRedisson() {


        lockSerivce.testDistroLockByRedisson();
        return Result.ok();

    }


}
